﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AXExtension
{
	static class StringExtensions
	{
		public static string OnlyNormals(this string self)
		{
			List<char> chars = new List<char>();

			foreach (var c in self)
			{
				if (char.IsLetter(c) || c == ' ' || c == '[' || c == ']' || c == '-' || c == '(' || c == ')')
				{
					chars.Add(c);
				}
			}
			return new string(chars.ToArray());
		}

		public static string Between(this string self, string left, string right)
		{
			return self.Split(new string[] { left }, StringSplitOptions.RemoveEmptyEntries)
				.Last().Split(new string[] { right }, StringSplitOptions.RemoveEmptyEntries).First();
		}
	}
}
